<?php
/**
 * Created by PhpStorm.
 * User: 17464
 * Date: 2019/12/24
 * Time: 16:32
 */

namespace App\Repositories;

use App\Models\FailedJobs;

class SystemRepository extends BaseRepositories
{
    /**
     * @var FailedJobs 注入的 model
     */
    protected $failedJobs;

    /**
     * SystemRepository constructor.
     * @param FailedJobs $failedJobs
     */
    public function __construct(FailedJobs $failedJobs)
    {
        $this->failedJobs = $failedJobs;
    }

    public function getFailedJobsPageRepository(array $data, $limit = LIMIT_PAGE){
        return $this->failedJobs
            ->orderByDesc('failed_at')
            ->paginate($limit);
    }
}
